<!DOCTYPE html>
<html lang="en">
<head>
<title>用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="js/jquery-1.11.1.min.js"></script>
</head>
<body>
<form action="/social/bind" method="post">
	<input type="text"  name="mobile" id="mobile" placeholder="手机号">
	<input type="text" name="smsCode" placeholder="验证码">
	<input onclick="sendSms()" type="button"  value="获取验证码" style="font-size:1em;color:#393838;background:#ffde3a;border:none;padding:0.5em 1.5em;outline:none;">
	<input type="submit"  value="登录" >
</form>
</body>
<script type="text/javascript" charset="utf-8">
    function sendSms() {
        var url = "/code/sms";
        var mobile = $("#mobile").val();
        $.ajax({
            url : url,
            method : 'get',
            data : {mobile : mobile},
            dataType : 'json',
            success : function(result) {
                alert(result.content);
            }
        })
    }

</script>
</html>